package io.gitee.chearnee.fw.theadpool.log;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;

/**
 * @author liting
 * @version 1.0.0
 * @Descpriont 阿里ttl在多线程情况下依然可以打印日志ApplicationRunner
 * (ApplicationContextInitializer不用这个,这个需要用到spi机制,感觉没必要用),总之想办法让TtlMDCAdapter初始化
 * @see TtlMDCAdapterInitializer
 * @since 1.0.0 2022-08-23
 */
@Slf4j
public class TtlMDCAdapterInitializer implements ApplicationRunner {

    @Override
    public void run(ApplicationArguments args) throws Exception {
        TtlMDCAdapter.getInstance();
        log.info("TtlMDCAdapterInitializer initialize finish");
    }

}

